#include <stdio.h>

int main() {
    int n;
    scanf("%d", &n);
    
    int sum = 0;
    int term = 0;
    
    for (int i = 1; i <= n; i++) {
        term = term * 10 + 6;  
        sum += term;           
    }
    
    printf("%d\n", sum);
    
    return 0;
} 